import React, { useState } from 'react';
import { Form, Input, Button, Table, Radio, Select, Upload } from 'antd';
import { UploadOutlined, InboxOutlined, DownloadOutlined } from '@ant-design/icons';
import { CloseOutlined } from '@ant-design/icons';
import './Timadd.scss';
import TimCon from './TimCon';
import TimPeople from './TimPeople';
import TimBase from './TimBase';

const TimDetail = (props) => {
    const [but, setbut] = useState(2)
    const TimReturn = () => {
        props.setState(1)
    }
    var com;
    if (but == 1) {
        com = <div className='Tenant_information_management' style={{ backgroundColor: "white" }}><TimBase setbut={setbut}></TimBase></div>
    }
    else if (but == 2) {
        com = <div className='Tenant_information_management' style={{ backgroundColor: "white" }}><TimPeople setbut={setbut}></TimPeople></div>
    }
    else if (but == 3) {
        com = <div className='Tenant_information_management' style={{ backgroundColor: "white" }}><TimCon setbut={setbut}></TimCon></div>
    }

    return (
        <div className='buildingAdd_box'>
            <Form name="horizontal_login" layout="inline" className='title '>

                <Form.Item
                    name="username">
                    <div className='kuai'>
                        <span></span>
                        <span>xxx公司</span>
                    </div>
                </Form.Item>
                <div style={{ flex: '2' }} className='changebut'>
                    <button className={but == 1 ? 'style2' : 'style1'} onClick={() => { setbut(1) }}>基本信息</button>
                    <button className={but == 2 ? 'style4' : 'style3'} onClick={() => { setbut(2) }}>人员信息</button>
                    <button className={but == 3 ? 'style6' : 'style5'} onClick={() => { setbut(3) }}>合同信息</button>
                </div>
                <Form.Item className='btn'>
                    <div>
                        <CloseOutlined onClick={TimReturn} style={{ fontSize: 20, cursor: " pointer" }} />
                    </div>

                </Form.Item>
            </Form>
            <div className='timborder'></div>
            <div className='TimDmain'>
                {com}
            </div>
        </div>)

}
export default TimDetail 